
package com.fx.apartment.modules.dynamic.wrapper;


import com.fx.apartment.modules.dynamic.entity.Comment;
import com.fx.apartment.modules.dynamic.vo.CommentVO;
import com.fx.apartment.common.support.BaseEntityWrapper;
import com.fx.apartment.common.tool.utils.BeanUtil;

import java.util.Objects;

/**
 * 朋友圈评论包装类,返回视图层所需的字段
 *
 * @author QinXueFeng
 * @since 2021-04-19
 */
public class CommentWrapper extends BaseEntityWrapper<Comment, CommentVO> {

	public static CommentWrapper build() {
		return new CommentWrapper();
 	}

	@Override
	public CommentVO entityVO(Comment comment) {
		CommentVO commentVO = Objects.requireNonNull(BeanUtil.copy(comment, CommentVO.class));

		//User createUser = UserCache.getUser(comment.getCreateUser());
		//User updateUser = UserCache.getUser(comment.getUpdateUser());
		//commentVO.setCreateUserName(createUser.getName());
		//commentVO.setUpdateUserName(updateUser.getName());

		return commentVO;
	}

}
